package at.ltasat;

import java.io.FileNotFoundException;
import java.util.Arrays;

import at.ltasat.solve.SolverMain;
import at.ltasat.train.classifier.TrainClassifierMain;
import at.ltasat.train.set.TrainingSetMain;
import at.ltasat.train.validation.ValidateClassifierMain;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {
		if (args.length == 0) {
			System.out.println("first argument needs to be 'solve' or 'create-training-set' or 'train-classifier'!");
		} else {
			String mode = args[0];
			args = Arrays.copyOfRange(args, 1, args.length);
			if (mode.equals("solve")) {
				SolverMain.main(args);
			} else if (mode.equals("create-trainingset")) {
				TrainingSetMain.main(args);
			} else if (mode.equals("train-classifier")) {
				TrainClassifierMain.main(args);
			} else if (mode.equals("validate-classifier")) {
				ValidateClassifierMain.main(args);
			} else {
				throw new IllegalArgumentException("Unknown mode: " + mode);
			}
		}
	}
}
